<%@ page contentType="text/html;charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="tags" tagdir="/WEB-INF/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>

<html>
<head>
    <title>挂靠上级单位</title>
    <script type="text/javascript" src="${ctx}/static/myJs/util.js"></script>
    <script type="text/javascript" src="${ctx}/static/myJs/groupController.js"></script>
</head>

<body>
<div class="content">
    <h3 class="item-title">挂靠上级组织</h3>
    <ol class="orgnization-list">

    <c:forEach items="${platformGroups}" var="item">
        <li class="list-item" id="platformGroups_${item.id}">
            <div class="orgnization-name">${item.parentCode}</div>
            <c:forEach items="${platforms}" var="item2">
                <c:if test="${item.platformId == item2.id}">
                    <div class="orgnization-parent-name">${item2.name}</div>
                </c:if>
            </c:forEach>
            <div class="pull-right">
                <div class="list-delete"><a href="javascript:void(0);" onclick="javascript:del('${item.id}');"><i class="fa fa-trash" aria-hidden="true"></i></a></div>
            </div>
        </li>
    </c:forEach>

    </ol>
    <div>
        <button class="btn" data-toggle="modal" data-target="#myModal"><i class="fa fa-plus" aria-hidden="true"></i></button>
    </div>
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" style="width: 490px;">
            <div class="modal-content">
                <div class="modal-body">
                    <div class="form-group">
                        <div class="form-item">
                            <label for="">上级组织类别</label>
                            <select class="form-control" id="platform">
                                <c:forEach items="${platforms}" var="item">
                                    <option value="${item.id}">${item.name}</option>
                                </c:forEach>
                            </select>
                        </div>
                        <div class="form-item">
                            <label for="">上级名称</label>
                            <input type="text" class="form-control" id="parentCode" placeholder="填写上级名称">
                        </div>
                    </div>
                </div>
                <div class="modal-footer">
                    <button class="btn" onclick="javascript:searchOrg();">挂靠</button>
                </div>



                <ol class="orgnization-list">
                    <li class="list-item">
                        <div class="orgnization-name">XXXXXXXXX团省委</div>
                        <div class="orgnization-parent-name">共青团</div>
                        <div class="pull-right">
                            <div class="list-delete"><a href="#"><i class="fa fa-trash" aria-hidden="true"></i></a></div>
                        </div>
                    </li>
                    <li class="list-item">
                        <div class="orgnization-name">XXXXXXXXX街道</div>
                        <div class="orgnization-parent-name">上文广</div>
                        <div class="pull-right">
                            <div class="list-delete"><a href="#"><i class="fa fa-trash" aria-hidden="true"></i></a></div>
                        </div>
                    </li>
                    <li class="list-item">
                        <div class="orgnization-name">XXXXXXXXX组织</div>
                        <div class="orgnization-parent-name">平台内</div>
                        <div class="pull-right">
                            <div class="list-delete"><a href="#"><i class="fa fa-trash" aria-hidden="true"></i></a></div>
                        </div>
                    </li>
                </ol>

                <div class="modal-footer">
                    <button class="btn" data-dismiss="modal">取消</button>
                    <button class="btn" onclick="javascript:join();">挂靠</button>
                </div>


            </div>
        </div>
    </div>
</div>
</div>
</body>
</html>
